<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>分布式DCOP工作站</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="easyui/demo/demo.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="gui.js"></script>
    <script type="text/javascript" src="toolbar.js"></script>
    <script type="text/javascript" src="dlgChooseAgentField.js"></script>
    <script type="text/javascript" src="getNewValue.js"></script>
</head>
<body class="easyui-layout">
<!--up-->
<div data-options="region:'north',border:false" style="height:150px;background:#B3DFDA;padding:10px">
    <div style="left: 50%; position: absolute; top: 50%; transform: translateX(-50%) translateY(-50%)">
        DCOPSolverInfrastructure <br>
        使用方法:<br>
        中间区域设置"参数信息","验证次数","选择问题文件(包含xml的zip文件)"然后点击"提交" <br>
        左侧区域显示工作站状态信息<br>
        右侧区域显示可下载文件
    </div>
    <div style="width: 200px; height: 20px; text-align: right; float: right; color: red">
        <input class="easyui-textbox" id="accountName" style="width: 100%;"
               data-options="label:'用户名:',labelPosition:'top'" editable="false" value="">
        <input class="easyui-textbox" id="accountRunningTask" style="width: 100%;"
               data-options="label:'运行中的任务:',labelPosition:'top'" editable="false" value="">
        <input class="easyui-textbox" id="accountRemainTask" style="width: 100%;"
               data-options="label:'还可添加任务:',labelPosition:'top'" editable="false" value="">
    </div>
</div>

<!--left-->
<div data-options="region:'west',split:true,collapsed:true,title:'工作站状态'" style="width:550px;padding:10px;">
    <a href="javascript:void(0)" id="btnRefreshStationState" class="easyui-linkbutton" onclick="fillStationState()">刷新工作站状态</a>
    <table class="easyui-datagrid" id="station-state" title="工作站" style="width:100%; height: 300px" data-options="
        rownumbers:true,
        ">
        <thead>
        <tr>
            <th data-options="field:'thStationName', width:180">工作站名</th>
            <th data-options="field:'thStationIP', width:180">HostAndPort</th>
            <th data-options="field:'thStationTaskNum', width:80">剩余任务</th>
            <th data-options="field:'thStationState', width:80">状态</th>
        </tr>
        </thead>
    </table>
</div>
<!--right-->
<div data-options="region:'east',split:true,collapsed:true,title:'下载区域'" style="width:550px;padding:10px;">
    <table class="easyui-datagrid" id="download-files" title="服务器文件" style="width:100%; height: 300px" data-options="
        method: 'get',
        rownumbers:true,
        checkbox: true,
        selectOnCheck: true,
        checkOnSelect: true,
        singleSelect: false,
        toolbar:fileTool
        ">
        <thead>
        <tr>
            <th data-options="field:'thSelect', checkbox:true">选择</th>
            <th data-options="field:'thFileName', width:280">文件名</th>
            <th data-options="field:'thTime', width:180">时间</th>
        </tr>
        </thead>
    </table>
</div>

<!--bottom-->
<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;">
    任何问题 请发送邮件到邮箱245878146@qq.com
</div>

<!--center-->
<div data-options="region:'center',title:'参数操作'" class="easyui-panel" style="background-color: lightcyan">
    <div style="padding: 10px 0"></div>
    <div style="width: 1000px; height: 300px; position: relative; left: 50%; transform: translateX(-50%)">
        <table id="tableParam" class="easyui-datagrid" title="参数设置" style="width: 100%; height: 100%"
               data-options="
               minWidth: 50,
               minHeight: 300,
               singleSelect:true,
               collapsible:true,
               multiSort:true,
               nowrap:false,
               rownumbers:true,
               toolbar:tableParamToolbar
            ">
            <thead>
            <tr>
                <th data-options="field:'thAgentName',width:200">代理名</th>
                <th data-options="field:'thFieldName',width:250">参数名</th>
                <th data-options="field:'thFieldType',width:150">参数类型</th>
                <th data-options="field:'thFieldValue',width:360">参数值</th>
            </tr>
            </thead>
        </table>
        <div style="padding: 10px 0"></div>
    </div>
    <div style="padding: 10px 0"></div>
    <form id="importFileForm" method="post" enctype="multipart/form-data">
        <div style="position: relative; width: 1000px; left: 50%; transform: translateX(-50%)">
            <input class="easyui-filebox" name="zipFile" style="width: 100%"
                   data-options="prompt:'选择一个zip文件',buttonText:'选择文件',required:true,label:'问题文件:'">
        </div>
        <div style="padding: 10px 0"></div>
        <div style="position: relative; width: 1000px; left: 50%; transform: translateX(-50%)">
            <input class="easyui-numberbox" name="validateTime" style="width: 100%"
                   data-options="prompt:'请输入需要的验证次数',required:true,label:'验证次数:'" value="2">
        </div>
        <div style="padding: 10px 0"></div>
        <div style="position: relative; width: 800px; height: 40px; left: 50%; transform: translateX(-50%)">
            <a href="javascript:void(0)" style="width: 100%; height: 100%;" id="btnSubmitTable" class="easyui-linkbutton" onclick="submitParam()">
                提交
            </a>
        </div>
        <div style="padding: 10px 0"></div>
        <div style="position: relative; width: 800px; height: 40px; left: 50%; transform: translateX(-50%)">
            <a href="javascript:void(0)" style="width: 100%; height: 100%" id="btnInit" class="easyui-linkbutton" onclick="init()">添加参数</a>
        </div>
    </form>
</div>

<!--dialog discrete parameter-->
<div id="dlgDiscrete" class="easyui-dialog" closed="true" title="离散值" style="width: 500px; height: 300px">
    <div style="margin: 20px 0;"></div>
    <input class="easyui-textbox" id="textboxReadDiscreteDefault" readonly="readonly" label="默认值:" labelPosition="left"
           precision="2" style="width:100%;">
    <div style="margin: 20px 0;"></div>
    <div style="margin-bottom: 20px">
        <select id="discreteValues" class="easyui-combobox" label="选择值：" style="width: 100%"></select>
    </div>
    <a href="javascript:void(0)" id="btnChooseDiscrete" class="easyui-linkbutton" onclick="chooseDiscrete()"
       style="left: 50%; position: absolute">
        添加
    </a>
</div>

<!--dialog continuous parameter-->
<div id="dlgContinuous" class="easyui-dialog" closed="true" title="连续值" style="width:400px;height:400px;padding:10px">
    <label>("新给的值"的集合必须在"需要满足的条件"的集合中,误差接受1e-9)</label>
    <br>
    <label>需要满足的条件: </label>
    <div style="margin: 5px 0"></div>
    <input class="easyui-numberbox" id="numboxReadLower" readonly="readonly" label="下限:" labelPosition="left"
           precision="2" style="width:100%;">
    <input class="easyui-numberbox" id="numboxReadUpper" readonly="readonly" label="上限:" labelPosition="left"
           precision="2" style="width:100%;">
    <input class="easyui-numberbox" id="numboxReadStep" readonly="readonly" label="步长:" labelPosition="left"
           precision="2" style="width:100%;">
    <input class="easyui-numberbox" id="numboxReadDefault" readonly="readonly" label="默认值:" labelPosition="left"
           precision="2" style="width:100%;">
    <br>
    <div style="padding: 10px"></div>
    <label>填写你给出的值:</label>
    <br>
    <input class="easyui-numberbox" id="numboxWriteLower" label="下限:" labelPosition="left" precision="2"
           style="width:100%;">
    <input class="easyui-numberbox" id="numboxWriteUpper" label="上限:" labelPosition="left" precision="2"
           style="width:100%;">
    <input class="easyui-numberbox" id="numboxWriteStep" label="步长:" labelPosition="left" precision="2"
           style="width:100%;">
    <div style="padding: 10px 0;"></div>
    <a href="javascript:void(0)" id="btnChooseContinuous" class="easyui-linkbutton" onclick="chooseContinuous()"
       style="left: 50%; position: absolute">
        添加
    </a>
</div>

<!--dialog hyper parameter-->
<div id="dlgHyper" class="easyui-dialog" closed="true" title="超参数" style="width:400px;height:200px;padding:10px">
    <input class="easyui-numberbox" id="numboxHyperReadDefault" readonly="readonly" label="默认值:" labelPosition="left"
           precision="2" style="width:100%;">
    <div style="padding: 10px 0"></div>
    <input class="easyui-numberbox" id="numboxHyperWrite" label="新值:" labelPosition="left" precision="2"
           style="width:100%;">
    <div style="padding: 10px 0"></div>
    <a href="javascript:void(0)" id="btnChooseHyper" class="easyui-linkbutton" onclick="chooseHyper()"
       style="left: 50%; position: absolute">
        添加
    </a>
</div>

<!--dialog choose agent and field-->
<div id="dlgChooseAgentField" class="easyui-dialog" closed="true" title="选择代理名和参数名"
     style="width:400px; height: 200px; padding: 10px">

    <form id="ff" method="post">
        <div style="margin:20px 0;"></div>
        <div style="margin-bottom:20px">
            <select id="agentsName" class="easyui-combobox" label="代理名:" name="agentName" style="width: 100%">
            </select>
        </div>
        <div style="margin-bottom:20px">
            <select id="fieldsName" data-options="editable:false" class="easyui-combobox" label="参数名:" name="fieldName"
                    style="width: 100%">
            </select>
        </div>
    </form>
</div>
</body>
</html>
